package com.igeek.health.mapper;

import com.igeek.health.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author fengqq
 * @since 2024-08-26
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    //根据角色id查询权限信息
    @Select("select p.* from permission p join role_permission rp on p.id=rp.permission_id where rp.role_id=#{roleId}")
    public Set<Permission> selectPermissionsByRoleId(Integer roleId);

}
